﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace keygen
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        string kod;
        Random rnd;
        private void button1_Click(object sender, EventArgs e)
        {
            kod = "";
            textBox1.Clear();
            rnd = new Random((int) DateTime.Now.Ticks);
            for (int i = 0; i <= 5; i++)
                kod += Convert.ToChar(rnd.Next(65, 90));
            for (int i = 0; i <= 4; i++)
            {
                kod += '-';
                for (int ii = 0; ii <= 5; ii++)
                    kod += Convert.ToChar(rnd.Next(65, 90));
            }
            textBox1.Text = kod;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            textBox1.Clear();
        }
    }
}
